<html>
<head>
  <title>Demo carrito</title>
  <script type="text/javascript" src="http://www.google.com/jsapi"></script>
  <script type="text/javascript">
    google.load("jquery", "1.4.4");
  </script><script type="text/javascript">
  function removeFromCart(productId) {
    $.post('/cart/remove/',
      { productId: productId },
      function(data){
      }
    );
  }

  </script>
</head>
<body>

<h1>Tu carrito</h1>

<div id="prods">
  {% if message %}
    <div id="msg-container">
        <p>{{ message }}</p>
    </div>
  {% endif %}
  
  <ul>
    {% if emptyCart %}
        <p>No hay nada en tu carrito. <a href="/">Ve a comprar algo!</a></p>
    {% else %}
      {% for product in products %}
        <li>{{ product.name }} | <a href="#" onclick="removeFromCart({{ product.prodId }});">Borrar del carrito</a></li>
      {% endfor %}
    {% endif %}
  </ul>
</div>

</body>
</html>